# MPI CMake 测试示例
# CMake输出不同系统下MPI的信息
# https://zhuanlan.zhihu.com/p/388967492?utm_id=0

cmake_minimum_required(VERSION 3.15)

message(STATUS "The CMAKE_VERSION is ${CMAKE_VERSION}.")

project(FindMPIPackage)
find_package(MPI REQUIRED)
message(STATUS "MPI_FOUND is ${MPI_FOUND}")
message(STATUS "CMAKE_FIND_PACKAGE_NAME is ${CMAKE_FIND_PACKAGE_NAME}")
message(STATUS "MPI_FIND_VERSION is ${MPI_FIND_VERSION}")
message(STATUS "MPI_VERSION is ${MPI_VERSION}")
message(STATUS "MPI_C_FOUND is ${MPI_C_FOUND}")
message(STATUS "MPI_CXX_FOUND is ${MPI_CXX_FOUND}")
message(STATUS "MPI_C_COMPILER is ${MPI_C_COMPILER}")
message(STATUS "MPI_CXX_COMPILER is ${MPI_CXX_COMPILER}")
message(STATUS "MPI_C_COMPILE_OPTIONS is ${MPI_C_COMPILE_OPTIONS}")
message(STATUS "MPI_CXX_COMPILE_OPTIONS is ${MPI_CXX_COMPILE_OPTIONS}")
message(STATUS "MPI_C_COMPILE_DEFINITIONS is ${MPI_C_COMPILE_DEFINITIONS}")
message(STATUS "MPI_CXX_COMPILE_DEFINITIONS is ${MPI_CXX_COMPILE_DEFINITIONS}")
message(STATUS "MPI_C_LINK_FLAGS is ${MPI_C_LINK_FLAGS}")
message(STATUS "MPI_CXX_LINK_FLAGS is ${MPI_CXX_LINK_FLAGS}")
message(STATUS "MPI_C_LIBRARIES is ${MPI_C_LIBRARIES}")
message(STATUS "MPI_CXX_LIBRARIES is ${MPI_CXX_LIBRARIES}")
message(STATUS "MPI_C_INCLUDE_DIRS is ${MPI_C_INCLUDE_DIRS}")
message(STATUS "MPI_CXX_INCLUDE_DIRS is ${MPI_CXX_INCLUDE_DIRS}")
message(STATUS "MPI_C_VERSION_MAJOR is ${MPI_C_VERSION_MAJOR}")
message(STATUS "MPI_CXX_VERSION_MAJOR is ${MPI_CXX_VERSION_MAJOR}")
message(STATUS "MPI_C_VERSION_MINOR is ${MPI_C_VERSION_MINOR}")
message(STATUS "MPI_CXX_VERSION_MINOR is ${MPI_CXX_VERSION_MINOR}")
message(STATUS "MPI_C_VERSION is ${MPI_C_VERSION}")
message(STATUS "MPI_CXX_VERSION is ${MPI_CXX_VERSION}")
message(STATUS "MPIEXEC_EXECUTABLE is ${MPIEXEC_EXECUTABLE}")
message(STATUS "MPIEXEC_NUMPROC_FLAG is ${MPIEXEC_NUMPROC_FLAG}")
message(STATUS "MPIEXEC_MAX_NUMPROCS is ${MPIEXEC_MAX_NUMPROCS}")
message(STATUS "MPIEXEC_PREFLAGS is ${MPIEXEC_PREFLAGS}")
message(STATUS "MPIEXEC_POSTFLAGS is ${MPIEXEC_POSTFLAGS}")
message(STATUS "MPI_LIBRARY_NAME is ${MPI_LIBRARY_NAME}")

message(STATUS "MPI_EXECUTABLE is ${MPI_EXECUTABLE}")
message(STATUS "MPI_INCLUDE_DIRS is ${MPI_INCLUDE_DIRS}")
message(STATUS "MPI_LIBS is ${MPI_LIBS}")